<?php
/* $Id$ */

require_once "lib/database/sql/MySQL.class.php";

class ProjectDatabase extends MySQL {


	private $project_class		= null;

	/* Tabellen */

	private $database_tables_array 				= array(
		"articles", "authors", "authors_roles", "categories", "container_contents", "container_filters",
		"database_security", "memberships", "messages", "projects", "sessions", "uploads"
	);

	function ProjectDatabase( $project_class, $profile_class ) {
		$this->MySQL( $profile_class );

		$this->project_class = $project_class;
		$this->preRegisterAllObjects();
	}

	function getProject_class() {
		return $this->project_class;
	}


	function preRegisterAllObjects() {

		/** SQL Callback Methoden registrieren **/

		$this->registerObjectMethod( "author_list", array( 
			$this->getProject_class(),	"sql_process_author_roles_as_list_of_objects_callback") 
		);
	
		$this->registerObjectMethod( "expired_sessions", array (
			$this->getProject_class(),	"sql_process_sessions_for_expired_once")
		); 


		/* - Callback Methoden mit HTML Rueckgabe: Autoren spezifische Tabellen */

		$this->registerObjectMethod( "author_list_html", array( 
			$this->getProject_class(), "sql_process_author_list_html_callback") 
		);
		$this->registerObjectMethod( "author_details_html", array( 
			$this->getProject_class(), "sql_process_author_details_html_callback") 
		);

		$this->registerObjectMethod( "author_roles_as_optionlist", array( 
			$this->getProject_class(), "sql_process_author_roles_as_option_list_callback") 
		);

		/* - Callback Methoden mit HTML Rueckgabe: Projekt spezifische Tabellen */

		$this->registerObjectMethod( "project_list_html", array( 
			$this->getProject_class(), "sql_process_project_list_html_callback") 
		);
		$this->registerObjectMethod( "project_details_html", array( 
			$this->getProject_class(), "sql_process_project_details_html_callback") 
		);

		$this->registerObjectMethod( "projects_as_optionlist", 
			array( $this->getProject_class(), "sql_process_project_as_option_list_callback") 
		);


	}

}

?>